#pragma once

#include "Defines.hpp"
#include "cybertron/node/TrafficActorHotArea.hpp"

class HotAreaSubscribable : public TrafficActorHotArea
{
public:
	HotAreaSubscribable();
	virtual ~HotAreaSubscribable();

	virtual void clear();

	void setCreator(SocketBasePtr pCreator);
	SocketBasePtr getCreator() const;

	void addSubscriber(SocketBasePtr pSocket);
	void removeSubscriber(SocketBasePtr pSocket);
	void dispatch(const Message& msg);

public:
	void sendEverything(SocketBasePtr pSocket);

private:
	void clearThis();
	void zeroMembers();

private:
	SocketBasePtr mCreator;
	std::set<SocketBasePtr> mSubscribers;
};
